package com.biz.primus.model.coupon.exceptions;

import com.biz.primus.base.exception.ExceptionType;

/**
 * 优惠券错误类型枚举
 *
 * @author david-liu
 */
public enum CouponExceptionType implements ExceptionType {
    CREATE_COUPON_USER_NOT_EXIST(902, "创建优惠券目标用户不能为空"),
    CREATE_COUPON_QUANTITY_ILLEGAL(903, "创建优惠券数量不能为空"),
    COUPON_INSUFFICIENT(904, "优惠券数量不足: %s"),
    COUPON_ISSUE_COUNT_ILLEGAL(905, "优惠券发行数量必须大于0"),
    COUPON_STATUS_ILLEGAL(906, "优惠券状态异常"),
    COUPON_ACQUIRE_APPROACH_NOT_ALLOW_NULL(907, "优惠券获取方式不能为空"),
    COUPON_USER_NOT_ALLOW_NULL(908, "用户ID不能为空"),
    GET_ORDER_PRODUCT_COUPON_PRODUCT_ID_NOT_ALLOW_NULL(909, "获取订单商品可用优惠券, 商品ID不能为空"),
    COUPON_ID_NOT_ALLOW_NULL(910, "优惠券ID不能为空"),
    COUPON_NOT_BELONG_TO_USER(911, "优惠券和用户不匹配, 未在用户的未使用优惠券列表种找到该优惠券");

    private int code;

    private String description;

    CouponExceptionType(int code, String description) {
        this.code = code;
        this.description = description;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getDescription() {
        return this.description;
    }
}
